package day06;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

/**
 * 创建一个"raf.dat"的文件，并在其中写出一个int的最大值，long的最大值，
 * 然后将其分别读取出来并输出
 * @author Bonnie
 *
 */
public class Test08 {
    public static void main(String[] args) throws IOException {
        FileWriter fw = new FileWriter("./Home_Work/src/day06/raf.dat");

        fw.write(Integer.toString(Integer.MAX_VALUE));
        fw.write("\r\n");
        fw.write(Long.toString(Long.MAX_VALUE));
        fw.write("\r\n");

        fw.close();

        FileReader fr = new FileReader("./Home_Work/src/day06/raf.dat");
        BufferedReader reader = new BufferedReader(fr);

        String line;
        line = reader.readLine();
        System.out.println("Int Max: " + Integer.parseInt(line));
        line = reader.readLine();
        System.out.println("Long Max: " + Long.parseLong(line));
        reader.close();
        fr.close();
    }
}
